<script type="text/javascript">
    var maxTime = 600; // seconds
    var time = maxTime;
    document.onclick=function () {
        time=maxTime;
    };
    var intervalId = setInterval(function(){
        time--;
        if(time <= 0) {
            ShowInvalidLoginMessage();
            clearInterval(intervalId);
        }
    }, 1000);
    function ShowInvalidLoginMessage(){
        // 清除session
        $.ajax({
            type:"post",
            url:"{:U('Check/logout')}",
            dataType:"json",
            data:{"true":1},
            success:function (phpdata) {
                layer.alert("سېستىمىنىڭ چېكىنىش ۋاقتى توشۇپ قالدى ، قايتا كىرىڭ ، خوش!", {
                    title:"سېستىما ئەسكەرتىشى",
                    btn:"بىلدىم",
                    icon: 4,
                    skin: 'layer-ext-moon',
                    time:5000
                });
                setTimeout(ok,5700);
            }

        });
        // 该干嘛干嘛
        function ok() {
            window.location="{:U('Login/index')}";
        }

    }

    //处理图片的url
    var img_src=$('img');
    var substr="http";
    for (var i=0;i<img_src.length;i++){
        var src_i=$(img_src).eq(i).attr("src");
        if(src_i.indexOf(substr)==1){
            src_i=src_i.replace("/http","http");
            $(img_src).eq(i).attr("src",src_i);
        }

    }
</script>
</body>
</html>